* admin_windows7_product_key_manipulation.txt
* 2023.02.25
* admin/ProductKey

1. DESCRIPTION
2. INSTALL
3. ACTIVATE
4. UNINSTALL
5. EXTRACT PRODUCT KEY FROM REGISTRY OR RUNNING IMAGE
6. CHANGE PRODUCT KEY IN THE IMAGE BEFORE INSTALL
7. KNOWN ISSUES
7.1. Messege `Error: 0xC004D307 The maximum allowed number of re-arms has been
     exceeded. You must re-install the OS before trying yo re-arm again`

-------------------------------------------------------------------------------
1. DESCRIPTION
-------------------------------------------------------------------------------
This is a readme file from the `contools` project.

-------------------------------------------------------------------------------
2. INSTALL
-------------------------------------------------------------------------------

To intall product keys:

1.) Open a command prompt as an Administrator.
2.) Enter `slmgr /ipk "<product-key>"` and wait for this to complete.

-------------------------------------------------------------------------------
3. ACTIVATE
-------------------------------------------------------------------------------

To activate product keys:

1.) Open a command prompt as an Administrator.
2.) Enter `slmgr /ato` and wait for this to complete.

-------------------------------------------------------------------------------
4. UNINSTALL
-------------------------------------------------------------------------------

To unintall product keys (based on: https://stackoverflow.com/questions/7759642/reset-windows-activation-remove-license-key ):

1.) Open a command prompt as an Administrator.
2.) Enter `slmgr /upk` and wait for this to complete. This will uninstall the
    current product key from Windows and put it into an unlicensed state.
3.) Enter `slmgr /cpky` and wait for this to complete. This will remove the
    product key from the registry if it's still there.
4.) Enter `slmgr /rearm` and wait for this to complete. This is to reset the
    Windows activation timers so the new users will be prompted to activate
    Windows when they put in the key.

-------------------------------------------------------------------------------
5. EXTRACT PRODUCT KEY FROM REGISTRY OR RUNNING IMAGE
-------------------------------------------------------------------------------

Read the `README_EN.txt` from `admin/ProductKey` directory for the details.

-------------------------------------------------------------------------------
6. CHANGE PRODUCT KEY IN THE IMAGE BEFORE INSTALL
-------------------------------------------------------------------------------

Change them in the script file:

`sources\$OEM$\$$\SETUP\SCRIPTS\SetupComplete.cmd`

-------------------------------------------------------------------------------
7. KNOWN ISSUES
-------------------------------------------------------------------------------

-------------------------------------------------------------------------------
7.1. Messege `Error: 0xC004D307 The maximum allowed number of re-arms has been
     exceeded. You must re-install the OS before trying yo re-arm again`
-------------------------------------------------------------------------------

Issue:

  You has been run `slmgr /rearm` more than 3 times.

Solution:

  Reset the registry key:

  HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows NT/CurrentVersion/SoftwareProtectionPlatform
  "SkipRearm"=dword:00000001
